﻿using Kernel.Buildin.Swagger;

namespace WebAPI.Configure.Swagger;

/// <summary>
/// 系统分组特性
/// </summary>
public class ApiGroupAttribute : Attribute
{
    public ApiGroupAttribute(params ApiGroupNames[] name)
    {
        GroupNames = name;
    }

    public ApiGroupNames[] GroupNames { get; set; }

    /// <summary>
    /// 忽略该api，不在swagger文档中显示
    /// </summary>
    public bool IgnoreApi { get; set; } = false;

}

/// <summary>
/// API分组枚举值
/// </summary>
public enum ApiGroupNames
{
    [GroupInfo(Title = "尚未分组", Description = "尚未分组相关接口")]
    NoGroup,

    [GroupInfo(Title = "登录认证", Description = "登录认证相关接口")]
    Identity,

    [GroupInfo(Title = "系统管理", Description = "系统管理相关接口")]
    SysMgr,

    [GroupInfo(Title = "全部", Description = "全部接口")]
    All,
}
